package runnerworm.core;

/**
 * <p>Title: ExceptionAvailableEvent</p>
 * <p>Description: It will hold exceptions to be shown to the user.</p>
 * @author Guilherme Mauro Germoglio Barbosa
 */

public class ExceptionAvailableEvent
    extends AvailableEvent {

  /**
   * The exception held.
   */
  private Exception exception;

  /**
   * Constructor, will need the event's source and the exception.
   * @param source The event's source.
   * @param exception The exception.
   */
  public ExceptionAvailableEvent(AvailableEventLauncher source, Exception exception) {
    super(source, EXCEPTION_AVAILABLE);
    this.exception = exception;
  }

  /**
   * Returns the exception.
   * @return The exception.
   */
  public Exception getException() {
    return exception;
  }

  /**
   * Returns the exception's message.
   * @return The exception's message.
   */
  public String getExceptionMessage() {
    return exception.getMessage();
  }

}